package com.crane.framework.vo;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import jakarta.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serial;
import java.io.Serializable;

import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;

import org.hibernate.validator.constraints.Length;

/**
 * @Author: ten.x @TableName sys_org @Date: 2024-02-04 01:26:05 @Version: V1.0
 */
@Data
@Accessors(chain = true)
@TableName(value = "sys_org")
@EqualsAndHashCode(callSuper = false)
public class OrgDetailVO implements Serializable {

  @Serial
  @TableField(exist = false)
  private static final long serialVersionUID = 1L;

  /** 主键：id */
  @TableId(value = "id")
  @Schema(description = "id")
  @Length(max = 64, message = "编码长度不能超过64")
  private String id;

  /** 父id */
  @Size(max = 64, message = "编码长度不能超过64")
  @TableField(value = "pid")
  @Schema(description = "父id")
  @Length(max = 64, message = "编码长度不能超过64")
  private String pid;

  /** 组织机构名 */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "name")
  @Schema(description = "组织机构名")
  @Length(max = 255, message = "编码长度不能超过255")
  private String name;

  /** 本机构路径（作为标识） */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "path")
  @Schema(description = "本机构路径（作为标识）")
  @Length(max = 255, message = "编码长度不能超过255")
  private String path;

  /** 全路径 */
  @TableField(value = "full_path")
  @Schema(description = "全路径")
  private String fullPath;

  /** 领导人id */
  @Size(max = 64, message = "编码长度不能超过64")
  @TableField(value = "leader_id")
  @Schema(description = "领导人id")
  @Length(max = 64, message = "编码长度不能超过64")
  private String leaderId;

  /** 排序 */
  @TableField(value = "order_number")
  @Schema(description = "排序")
  private Integer orderNumber;

  /** 逻辑删除 */
  @Size(max = 255, message = "编码长度不能超过255")
  @TableField(value = "deleted")
  @Schema(description = "逻辑删除")
  @Length(max = 255, message = "编码长度不能超过255")
  private String deleted;

  /** 多租户 */
  @Size(max = 64, message = "编码长度不能超过64")
  @TableField(value = "tenant_id")
  @Schema(description = "多租户")
  @Length(max = 64, message = "编码长度不能超过64")
  private String tenantId;

  /** 创建时间 */
  @TableField(value = "gmt_create")
  @Schema(description = "创建时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime gmtCreate;

  /** 修改时间 */
  @TableField(value = "gmt_modified")
  @Schema(description = "修改时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime gmtModified;
}
